<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="bocMain"/>
    <title>进件作业系统</title>

</head>

<body>
<header class="header-title">申请人信息</header>

<g:form action="contactBaseInfoSave" method="post" class="myForm">
    <input type="hidden" name="id" id="id" value="${this?.opportunity?.id}">

    <div class="weui-cells weui-cells_form weui-label-10">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.fullName" value="${this?.opportunity?.contact?.fullName}" readonly="true"/>
            </div>
        </div>
        <div class="weui-flex">
            <div class="weui-flex__item" style="margin-right: 6px;">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label style="width: 2rem" class="weui-label">姓</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="contact.firstName" value="${this?.opportunity?.contact?.firstName}"/>
                    </div>
                </div>
            </div>
            <div class="weui-flex__item">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label style="width: 2rem" class="weui-label">名</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="contact.lastName" value="${this?.opportunity?.contact?.lastName}"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="weui-flex">
            <div class="weui-flex__item" style="margin-right: 6px;">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label style="width: 5rem" class="weui-label">姓(拼音)</label></div>

                    <div class="weui-cell__bd">
                         <g:textField class="weui-input" name="contact.firstNameSpell" value="${this?.opportunity?.contact?.firstNameSpell}"/>
                    </div>
                </div>
            </div>
            <div class="weui-flex__item">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label style="width: 5rem" class="weui-label">名(拼音)</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="contact.lastNameSpell" value="${this?.opportunity?.contact?.lastNameSpell}"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">婚姻状况</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.maritalStatus"
                             value="${this?.opportunity?.contact?.maritalStatus}" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">性别</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.gender" value="${this?.opportunity?.contact?.gender}"
                             readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">出生日期</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="birthdayStr" id="birthdayStr"
                             value="${this?.opportunity?.contact?.birthday?.format('yyyy年MM月dd日')}"
                             readonly="true"></g:textField>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">移动电话</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.cellphone"
                             value="${this?.opportunity?.contact?.cellphone}" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">证件类型</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="identityTypeStr"
                             value="${this.opportunity?.contact?.identityType?.name}" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">证件号码</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.idNumber"
                             value="${this.opportunity?.contact?.idNumber}"></g:textField>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">住址</label></div>

            <div class="weui-cell__bd">
                <textArea class="weui-textarea autoheighTextArea"  name="contact.nativePlace" id="nativePlace" readonly="true">${this.opportunity?.contact?.nativePlace}</textArea>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">证件地址4</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="name14" id="name14" value="CN：中国" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">证件地址3</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.nativeProvince" id="nativeProvince"
                          from="${com.next.Province.list()}" optionValue="name" optionKey="id"
                          value="${this.opportunity?.contact?.nativeProvince?.id}" noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">证件地址2</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.nativeCity" id="nativeCity"
                          from="${com.next.City.findAllByProvince(this?.opportunity?.contact?.nativeProvince)}"
                          optionValue="name" optionKey="id" value="${this.opportunity?.contact?.nativeCity?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">证件地址1</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.nativeDistrict" id="nativeDistrict"
                          from="${com.next.District.findAllByCity(this?.opportunity?.contact?.nativeCity)}"
                          optionKey="id" optionValue="name" value="${this.opportunity?.contact?.nativeDistrict?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">证件住址详情</label></div>

            <div class="weui-cell__bd">
                <textArea class="weui-textarea autoheighTextArea" name="contact.nativePlaceDetail" id="nativePlaceDetail" placeholder="请输入">${this.opportunity?.contact?.nativePlaceDetail}</textArea>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">客户户籍</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.householdRegistrationType" id="householdRegistrationType"
                          from="${com.next.Contact.constrainedProperties.householdRegistrationType.inList}"
                          value="${this.opportunity?.contact?.householdRegistrationType}" noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">文化程度</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.certificate" id="certificate" optionKey="id"
                          optionValue="name"
                          from="${com.next.Certificate.findAllByType(com.next.CertificateType.findByName('文化程度'))}"
                          value="${this.opportunity?.contact?.certificate?.id}" noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">最高学历</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.highestCertificate" id="highestCertificate" optionKey="id"
                          optionValue="name"
                          from="${com.next.Certificate.findAllByType(com.next.CertificateType.findByName('最高学历'))}"
                          value="${this.opportunity?.contact?.highestCertificate?.id}" noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">FAIRS分类</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.fairsType" placeholder="请输入" value="非美国人"
                             readonly="true"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">房产套数</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" id="numberOfHouse" name="contact.numberOfHouse" from="${[1, 2, 3]}"
                          value="${this?.opportunity?.contact?.numberOfHouse}" noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div id="house1" class="hide">

            <div class="weui-cell weui-cell_select weui-cell_select-after">
                <div class="weui-cell__hd"><label class="weui-label">房产城市*1</label></div>

                <div class="weui-cell__bd">
                    <g:select class="weui-select" name="house1.city" from="${com.next.City.list()}" optionKey="id"
                              optionValue="name" value="${this.opportunity?.contact?.city?.id}"
                              noSelection="${['': '请选择']}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产地址*1</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="house1.address" id="house1Address" placeholder="请输入"/>
                    <input class="weui-input hide" type="text" name="house1.status" value="Completed"/>
                    <input class="weui-input hide" type="text" name="house1.opportunity"
                           value="${this?.opportunity?.id}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产面积*1</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" name="house1.area" id="house1Area" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit"
                                                  style="width: 25px !important;">m<sup>2</sup></label></div>
            </div>
        </div>

        <div id="house2" class="hide">

            <div class="weui-cell weui-cell_select weui-cell_select-after">
                <div class="weui-cell__hd"><label class="weui-label">房产城市*2</label></div>

                <div class="weui-cell__bd">
                    <g:select class="weui-select" name="house2.city" from="${com.next.City.list()}" optionKey="id"
                              optionValue="name" value="${this.opportunity?.contact?.city?.id}"
                              noSelection="${['': '请选择']}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产地址*2</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="house2.address" id="house2Address" placeholder="请输入"/>
                    <input class="weui-input hide" type="text" name="house2.status" value="Completed"/>
                    <input class="weui-input hide" type="text" name="house2.opportunity"
                           value="${this?.opportunity?.id}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产面积*2</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" name="house2.area" id="house2Area" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit"
                                                  style="width: 25px !important;">m<sup>2</sup></label></div>
            </div>
        </div>

        <div id="house3" class="hide">

            <div class="weui-cell weui-cell_select weui-cell_select-after">
                <div class="weui-cell__hd"><label class="weui-label">房产城市*3</label></div>

                <div class="weui-cell__bd">
                    <g:select class="weui-select" name="house3.city" from="${com.next.City.list()}" optionKey="id"
                              optionValue="name" value="${this.opportunity?.contact?.city?.id}"
                              noSelection="${['': '请选择']}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产地址*3</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="house3.address" id="house3Address" placeholder="请输入"/>
                    <input class="weui-input hide" type="text" name="house3.status" value="Completed"/>
                    <input class="weui-input hide" type="text" name="house3.opportunity"
                           value="${this?.opportunity?.id}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">房产面积*3</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" name="house3.area" id="house3Area" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit"
                                                  style="width: 25px !important;">m<sup>2</sup></label></div>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">是否为优质行业</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" id="isHighQualityIndustry" name="contact.isHighQualityIndustry"
                          from="${[[name: '是', value: true], [name: '否', value: false]]}" optionKey="value"
                          optionValue="name" value="${this?.opportunity?.contact?.isHighQualityIndustry}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <input type="hidden" name="contact.accumulationFund" id="accumulationFund"
               value="${this?.opportunity?.contact?.accumulationFund}">
        <input type="hidden" name="contact.socialSecurity" id="socialSecurity"
               value="${this?.opportunity?.contact?.socialSecurity}">
        <input type="hidden" name="contact.individualIncomeTax" id="individualIncomeTax"
               value="${this?.opportunity?.contact?.individualIncomeTax}">

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">是否缴纳</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" id="isPay" name="isPay" from="${["公积金", "社保", "个税"]}" value=""
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="hide" id="accumulationFundActive">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人缴纳比例</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="housingFundPersonalRatio"
                           name="housingFundPersonalRatio"
                           value="${this?.opportunity?.contact?.housingFundPersonalRatio ? this?.opportunity?.contact?.housingFundPersonalRatio * 100 : null}"
                           placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">%</label></div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人月缴纳金额</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="housingFundPersonalAmount"
                           name="contact.housingFundPersonalAmount"
                           value="${this?.opportunity?.contact?.housingFundPersonalAmount}" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>
            </div>
        </div>

        <div class="hide" id="socialSecurityActive">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人缴纳比例</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="socialInsurancePersonalRatio"
                           name="socialInsurancePersonalRatio"
                           value="${this?.opportunity?.contact?.socialInsurancePersonalRatio ? this?.opportunity?.contact?.socialInsurancePersonalRatio * 100 : null}"
                           placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">%</label></div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人月缴纳金额</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="socialInsurancePersonalAmount"
                           name="contact.socialInsurancePersonalAmount"
                           value="${this?.opportunity?.contact?.socialInsurancePersonalAmount}" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>
            </div>
        </div>

        <div class="hide" id="individualIncomeTaxPersonalAmountActive">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人缴纳比例</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="individualIncomeTaxPersonalRatio"
                           name="individualIncomeTaxPersonalRatio"
                           value="${this?.opportunity?.contact?.individualIncomeTaxPersonalRatio ? this?.opportunity?.contact?.individualIncomeTaxPersonalRatio * 100 : null}"
                           placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">%</label></div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">个人月缴纳金额</label></div>

                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" id="individualIncomeTaxPersonalAmount"
                           name="contact.individualIncomeTaxPersonalAmount"
                           value="${this?.opportunity?.contact?.individualIncomeTaxPersonalAmount}" placeholder="请输入"/>
                </div>

                <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">现住房来源及居住状况</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.houseOrigin" id="houseOrigin"
                          from="${com.next.HouseOrigin.list()}" optionKey="id"
                          optionValue="name" value="${this.opportunity?.contact?.houseOrigin?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">现住址时间</label></div>

            <div class="weui-cell__bd">
                <input class="weui-input" type="text" name="contact.residentialDuration" id="residentialDuration"
                       placeholder="请输入" value="2019-01-01 &nbsp;"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">常住地址4</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="name4" id="name4" value="CN：中国" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">常住地址3</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.province" id="province" from="${com.next.Province.list()}"
                          optionValue="name" optionKey="id" value="${this.opportunity?.contact?.province?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">常住地址2</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.city" id="city"
                          from="${com.next.City.findAllByProvince(this?.opportunity?.contact?.province)}"
                          optionValue="name" optionKey="id" value="${this.opportunity?.contact?.city?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">常住地址1</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.district" id="district"
                          from="${com.next.District.findAllByCity(this?.opportunity?.contact?.city)}" optionKey="id"
                          optionValue="name" value="${this.opportunity?.contact?.district?.id}"
                          noSelection="${['': '请选择']}"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">常住地址详情</label></div>

            <div class="weui-cell__bd">
                <textArea class="weui-textarea autoheighTextArea" name="contact.address" id="address" placeholder="请输入">${this?.opportunity?.contact?.nativePlaceDetail}</textArea>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">常住地址邮编</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.zipCode" id="zipCode"
                             value="${this?.opportunity?.contact?.zipCode}" placeholder="请输入"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">Email</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="contact.email" id="email"
                             value="${this?.opportunity?.contact?.email}" placeholder="请输入"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">居住国家和地区</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="name3" id="name3" value="中国" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">国家/地区（国籍）</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="name2" id="name2" value="中国" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">国民经济部门</label></div>

            <div class="weui-cell__bd">
                <g:textField class="weui-input" name="name1" id="name1" value="住户" readonly="true"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">是否为居民</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" name="contact.isResident" id="isResident"
                          from="${[[name: '是', value: true], [name: '否', value: false]]}" optionKey="value"
                          optionValue="name" noSelection="${['': '请选择']}"
                          value="${this.opportunity?.contact?.isResident ?: true}"/>
            </div>
        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label">通讯语言</label></div>

            <div class="weui-cell__bd">
                <g:select class="weui-select" id="language" name="contact.language"
                          from="${com.next.Contact.constrainedProperties.language.inList}"
                          value="${this.opportunity?.contact?.language ?: '中文'}"
                          noSelection="${['': '请选择']}"></g:select>
            </div>
        </div>
    </div>
</g:form>
<div class="bigBtn">
    <button type="button" class="weui-btn weui-btn_primary" id="submit">下一步</button>
</div>
<asset:javascript src="boc/textAutoHeight.js"/>

<script>

    $(function () {
        // 使用
        $('textarea').autoHeight();

        var accumulationFund = $("#accumulationFund").val();
        var socialSecurity = $("#socialSecurity").val();
        var individualIncomeTax = $("#individualIncomeTax").val();
        if (accumulationFund) {
            $("#isPay").val('公积金');
            accumulationFundFuction();
        }
        else if (socialSecurity) {
            $("#isPay").val('社保');
            socialSecurityFuction();
        }
        else if (individualIncomeTax) {
            $("#isPay").val('个税');
            individualIncomeTaxPersonalFuction();
        }

        $("#isPay").bind("change", function () {
            var isPay = $("#isPay").val().trim();
            if (isPay == "公积金") {
                $("#accumulationFund").val(true);
                $("#socialSecurity").val(false);
                $("#individualIncomeTax").val(false);
                accumulationFundFuction()
            }
            if (isPay == "社保") {
                $("#socialSecurity").val(true);
                $("#accumulationFund").val(false);
                $("#individualIncomeTax").val(false);
                socialSecurityFuction()
            }
            if (isPay == "个税") {
                $("#individualIncomeTax").val(true);
                $("#socialSecurity").val(false);
                $("#accumulationFund").val(false);
                individualIncomeTaxPersonalFuction()
            }
        });

        $("#numberOfHouse").bind("change", function () {
            var numberOfHouse = $("#numberOfHouse").val().trim();
            if (numberOfHouse == 1) {
                $('#house1').removeClass("hide");
                $('#house2').addClass("hide");
                $('#house3').addClass("hide");
            } else if (numberOfHouse == 2) {
                $('#house1').removeClass("hide");
                $('#house2').removeClass("hide");
                $('#house3').addClass("hide");
            } else if (numberOfHouse == 3) {
                $('#house1').removeClass("hide");
                $('#house2').removeClass("hide");
                $('#house3').removeClass("hide");
            } else {
                $('#house1').addClass("hide");
                $('#house2').addClass("hide");
                $('#house3').addClass("hide");
            }
        });

        $("#residentialDuration").datetimePicker({
            title: "选择现住址时间",
            toolbarCloseText: "完成",
            times: function () {
                return [{
                    values: ['&nbsp;']
                }]
            },
        });

        $("#submit").click(function () {
            // var seniority = $("#seniority").val().trim();
            // if (!seniority) {
            //     helpMessage("请输入工作年限");
            //     return;
            // }

            var email = $("#email").val().trim();
            if (email && !(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(email))) {
                helpMessage("请输入正确Email");
                return;
            }

            var zipCode = $("#zipCode").val().trim();
            if (zipCode && zipCode.length > 6) {
                helpMessage("请输入正确邮编");
                return;
            }

            var numberOfHouse = $("#numberOfHouse").val();
            if (numberOfHouse >= 1) {
                var house1Address = $("#house1Address").val();
                if (!house1Address) {
                    helpMessage("请输入房产1地址");
                    return;
                }
                var house1Area = $("#house1Area").val();
                if (!house1Area) {
                    helpMessage("请输入房产1面积");
                    return;
                }
            }
            if (numberOfHouse >= 2) {
                var house2Address = $("#house2Address").val();
                if (!house2Address) {
                    helpMessage("请输入房产2地址");
                    return;
                }
                var house2Area = $("#house2Area").val();
                if (!house2Area) {
                    helpMessage("请输入房产2面积");
                    return;
                }
            }
            if (numberOfHouse == 3) 
            {
                var house3Address = $("#house3Address").val();
                if (!house3Address) {
                    helpMessage("请输入房产3地址");
                    return;
                }
                var house3Area = $("#house3Area").val();
                if (!house3Area) {
                    helpMessage("请输入房产3面积");
                    return;
                }
            }

            // var socialSecurity = $("#socialSecurity").val().trim()
            // var socialInsurancePersonalAmount = $("#socialInsurancePersonalAmount").val().trim()
            // if (socialSecurity == 'true' && !socialInsurancePersonalAmount)
            // {
            //     helpMessage("请输入社保缴纳金额");
            //     return;
            // }

            $(".myForm").submit();
        })

        function accumulationFundFuction() {
            $('#accumulationFundActive').removeClass("hide");
            $('#socialSecurityActive').addClass("hide");
            $('#individualIncomeTaxPersonalAmountActive').addClass("hide");
        }

        function socialSecurityFuction() {
            $('#accumulationFundActive').addClass("hide");
            $('#socialSecurityActive').removeClass("hide");
            $('#individualIncomeTaxPersonalAmountActive').addClass("hide");
        }

        function individualIncomeTaxPersonalFuction() {
            $('#accumulationFundActive').addClass("hide");
            $('#socialSecurityActive').addClass("hide");
            $('#individualIncomeTaxPersonalAmountActive').removeClass("hide");
        }

        function helpMessage(message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }

        $("#nativeProvince").bind("change", function () {
            $("#nativeCity option").remove();
            $("#s2id_nativeCity span:first").html("请选择");
            $("#nativeCity").append("<option value='' >请选择</option>")
            $("#nativeDistrict option").remove();
            $("#s2id_nativeDistrict span:first").html("请选择");
            $("#nativeDistrict").append("<option value='' >请选择</option>")
            var nativeProvince = $("#nativeProvince").val()
            if (!nativeProvince) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getCityByProvinceId",
                type: "POST",
                data: {'provinceId': nativeProvince},
                success: function (result) {
                    console.log(result)
                    for (var i = 0; i < result.list.length; i++) {
                        $("#nativeCity").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            });
        });

        $("#nativeCity").bind("change", function () {
            $("#nativeDistrict option").remove();
            $("#s2id_nativeDistrict span:first").html("请选择");
            var nativeCity = $("#nativeCity").val()
            $("#nativeDistrict").append("<option value='' >请选择</option>")
            if (!nativeCity) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getDistrictByCityId",
                type: "POST",
                data: {'cityId': nativeCity},
                success: function (result) {
                    console.log(result);
                    for (var i = 0; i < result.list.length; i++) {
                        $("#nativeDistrict").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            })
        });

        $("#province").bind("change", function () {
            $("#city option").remove();
            $("#s2id_city span:first").html("请选择");
            $("#city").append("<option value='' >请选择</option>")
            $("#district option").remove();
            $("#s2id_district span:first").html("请选择");
            $("#district").append("<option value='' >请选择</option>")
            var province = $("#province").val()
            if (!province) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getCityByProvinceId",
                type: "POST",
                data: {'provinceId': province},
                success: function (result) {
                    for (var i = 0; i < result.list.length; i++) {
                        $("#city").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            });
        });

        $("#city").bind("change", function () {
            $("#district option").remove();
            $("#s2id_district span:first").html("请选择");
            $("#district").append("<option value='' >请选择</option>")
            var city = $("#city").val()
            if (!city) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getDistrictByCityId",
                type: "POST",
                data: {'cityId': city},
                success: function (result) {
                    for (var i = 0; i < result.list.length; i++) {
                        $("#district").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            });
        });

    });


</script>
</body>
</html>
